package ligne2vie.topos.server.bo;

import java.io.Serializable;

import javax.jdo.annotations.PersistenceCapable;

import ligne2vie.topos.shared.bo.TSummit;

/**
 * The class {@link Summit} is a business object modeling a summit, inheriting from a {@link MapPoint}.
 * 
 * @author thuguerre
 * @since 1.0.0
 */
@PersistenceCapable(detachable="true")
public class Summit extends MapPoint implements Serializable {

	/**
	 * Default serial UID.
	 */
	private static final long serialVersionUID = -6761276368781033318L;

	/**
	 * Specialized constructor.
	 * 
	 * @param name
	 *            Summit's name.
	 * @param altitude
	 *            Summit's altitude.
	 * @param latitude
	 *            Summit's latitude.
	 * @param longitude
	 *            Summit's longitude.
	 * @param description
	 *            Summit's description.
	 */
	public Summit(String name, int altitude, double latitude, double longitude, String description) {

		super();
		this.name = name;
		this.latitude = latitude;
		this.longitude = longitude;
		this.altitude = altitude;
		this.description = description;
		this.state = EntityState.TO_VERIFY;
	}

	/**
	 * Convert current BO object into Facade objects.
	 * 
	 * @return Converted facade object.
	 */
	public TSummit getTSummit() {

		return new TSummit(this.id.getId(), name, altitude, latitude, longitude, description);
	}
}
